* {
  box-sizing: border-box;
}

body {
  height: 100vh;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #f4f7fb;
  font-family: "Poppins", sans-serif;
}

.input-container {
  position: relative;
  width: 250px;
}

.input-container input[type="text"] {
  font-size: 1rem;
  width: 100%;
  border: none;
  border-bottom: 2px solid #b0bec5;
  padding: 8px 0;
  background-color: transparent;
  outline: none;
  color: #222;
}

.input-container .label {
  position: absolute;
  top: 0;
  left: 0;
  color: #78909c;
  transition: all 0.3s ease;
  pointer-events: none;
}

.input-container input[type="text"]:focus ~ .label,
.input-container input[type="text"]:valid ~ .label {
  top: -20px;
  font-size: 0.85rem;
  color: #1565c0; /* highlight color */
}

.input-container .underline {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 100%;
  background-color: #1565c0;
  transform: scaleX(0);
  transition: transform 0.3s ease;
  transform-origin: left;
}

.input-container input[type="text"]:focus ~ .underline,
.input-container input[type="text"]:valid ~ .underline {
  transform: scaleX(1);
}
